package days48;

import java.util.Scanner;

public class five {
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int a=scanner.nextInt();
        int[]arr=new int[a];
        for (int i = 0; i < a; i++) {
            arr[i]=scanner.nextInt();
        }
        if(a==1){
            System.out.println(arr[0]);
        }
        int max=Integer.MIN_VALUE;
        int j=0;
        for (int i = 0; j < a; i++) {
            j=i+1;
            if( j < a&&arr[j]<=arr[i]+arr[j]){
                arr[j]=arr[i]+arr[j];
            }
            max=Math.max(max,arr[j-1]);
        }
        System.out.println(max);
    }

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        String a=scanner.next();
        int count=0;
        for (int i = 0; i <= str.length(); i++) {
            StringBuilder builder=new StringBuilder(str);
            builder.insert(i,a);
            if(juage(builder)){
                count++;
            }
        }
            System.out.println(count);
    }

    private static boolean juage(StringBuilder builder) {
        int k=builder.length();
        for (int i = 0; i < k; i++) {
            if(builder.charAt(i)!=builder.charAt(k-1-i)){
                return false;
            }
        }
        return true;
    }
}
